<!--
 * @Author: zxh
 * @Email: 1271027008@qq.com
 * @Date: 2020-03-18 11:29:40
 * @Descripttion: 
 -->
<div class="my_news_container">
    <div nz-row>
        <button nz-button nzType="primary" (click)="showSend()">发消息</button>
    </div>
    <div nz-row class="table_row">
        <nz-table #rowSelectionTable [nzFrontPagination]="false" [nzData]="listOfAllData"
            (nzCurrentPageDataChange)="currentPageDataChange($event)" [nzBordered]="true" nzSize="small">
            <thead>
                <tr>
                    <th nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked" [nzIndeterminate]="isIndeterminate"
                        (nzCheckedChange)="checkAll($event)"></th>
                    <th>编号</th>
                    <th>主题</th>
                    <th>时间</th>
                    <th>发送人</th>
                    <th>操作</th>
                    <th>备用</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let data of rowSelectionTable.data">
                    <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="refreshStatus()"></td>
                    <td>{{ data.code }}</td>
                    <td>{{ data.theme }}</td>
                    <td>{{ data.time }}</td>
                    <td>{{ data.sender }}</td>
                    <td>
                        <button (click)="showLook()" nz-button nzType="default" style="margin-right: 10px;">
                            <i nz-icon nzType="eye" nzTheme="outline"></i>
                        </button>
                        <button nz-button nzType="danger" (click)="delNews()">
                            <i nz-icon nzType="delete" nzTheme="outline"></i>
                        </button>
                    </td>
                    <td>{{ data.mark }}</td>
                </tr>
            </tbody>
        </nz-table>
    </div>
    <div nz-row class="page_row">
        <nz-pagination [nzPageIndex]="1" [nzTotal]="85" [nzPageSize]="10" [nzShowTotal]="totalTemplate"></nz-pagination>
        <ng-template #totalTemplate let-total> 总共 85 条 </ng-template>
    </div>
</div>
<div id="modal_box_1"></div>
<nz-modal class="modal_look" nzMaskClosable="false" appDragModal [(nzVisible)]="isVisibleLook"
    [nzGetContainer]="modalDomBoxA" nzTitle="查看消息" (nzOnCancel)="handleCancelLook()" (nzOnOk)="handleOkLook()"
    [nzCancelText]="null" nzOkText="关闭">
    <div nz-row nzGutter="16">
        <div nz-col nzSpan="24" class="col_1">
            <label nz-col nzSpan="4" class="label">发送人：</label>
            <div nz-col nzSpan="20">
                <input nz-input [(ngModel)]="sender" readonly>
            </div>
        </div>
        <div nz-col nzSpan="24" class="col_1">
            <label nz-col nzSpan="4" class="label">接收人：</label>
            <div nz-col nzSpan="20">
                <input nz-input [(ngModel)]="receiver" readonly>
            </div>
        </div>
        <div nz-col nzSpan="24" class="col_1">
            <label nz-col nzSpan="4" class="label">标题：</label>
            <div nz-col nzSpan="20">
                <input nz-input [(ngModel)]="titleLook" readonly>
            </div>
        </div>
        <div nz-col nzSpan="24" class="col_1">
            <label nz-col nzSpan="4" class="label">内容：</label>
            <div nz-col nzSpan="20">
                <textarea rows="4" nz-input [(ngModel)]="contentLook"></textarea>
            </div>
        </div>
    </div>
</nz-modal>
<div id="modal_box_2"></div>
<nz-modal class="modal_send" nzMaskClosable="false" appDragModal [(nzVisible)]="isVisibleSend"
    [nzGetContainer]="modalDomBoxB" nzTitle="消息对话框" (nzOnCancel)="handleCancelSend()" [nzFooter]="null">
    <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>接收</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请选择接收人员!">
                <nz-tree-select [nzDropdownStyle]="{left : '-200px'}" formControlName="sender" style="width: 100%;" [nzNodes]="userList"
                    (ngModelChange)="sendChange($event)">
                </nz-tree-select>
            </nz-form-control>
        </nz-form-item>
        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired >标题</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入标题!">
                <input nz-input formControlName="title" placeholder="标题不超过20字" maxlength="20"/>
            </nz-form-control>
        </nz-form-item>
        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired >内容</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入标题!">
                <textarea rows="5" nz-input formControlName="content" maxlength="100" placeholder="内容不超过100字"></textarea>
            </nz-form-control>
        </nz-form-item>
        <div nz-row class="footer_row">
            <button nz-button nzType="default" (click)="handleCancelSend()">取消</button>
            <button nz-button nzType="primary">确定</button>
        </div>
    </form>
</nz-modal>